<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="./../template/main.xhtml">
        <ui:define name="content">
            <h:form>
                <p:panel styleClass="FORM_HEADER_NEW">
                    <h:outputText value="Create Job" styleClass="FORM_HEADER_NEW"/>    
                </p:panel>
                <h:panelGrid columns="3" styleClass="APPLICATION_CONTENT"
                             cellpadding="2">
                    <h:outputText  value=""/>
                    <h:inputHidden id="id" value="#{jobController.jobDTO.id}"/>
                    <p:message for="id"/>

                    <p:outputLabel for="departmentId" value="Department: "/>
                    <p:selectOneMenu id="departmentId" value="#{jobController.jobDTO.departmentId}">
                        <f:selectItems value="#{jobController.departmentList}" var="department"
                                       itemValue="#{department.id}" itemLabel="#{department.name}" />
                    </p:selectOneMenu>
                    <p:message for="departmentId"/>

                    <p:outputLabel for="name" value="Name:"/>
                    <p:inputText id="name" value="#{jobController.jobDTO.name}"
                                 required="true" requiredMessage="Enter the value."/>
                    <p:message for="name"/>

                    <h:outputText value=""/>
                    <p:commandButton value="Save" action="#{jobController.save()}"
                                     ajax="true"/>
                    <h:outputText/>
                </h:panelGrid>
            </h:form>
        </ui:define>
    </ui:composition>
</html>